const pictureModel = require("../models/pictureModel")

// 轮播图类
class Picture {
    search(keyword) {
        return pictureModel.search(keyword)
    }
    publish(photo_title, photo_url) {
        const date = new Date().toLocaleString()
        const createAt = date
        return pictureModel.publish(photo_title, createAt, photo_url)
    }
    modify(photo_title, photo_url, id) {
        const date = new Date().toLocaleString()
        const createAt = date
        return pictureModel.modify(photo_title, createAt, photo_url, id)
    }
    remove(id) {
        return pictureModel.remove(id)
    }
    items(page_num, page_size) {
        return pictureModel.items(page_num, page_size)
    }
}

// 把业务操作的类挂载到模型系统上
module.exports = Picture